<template>
  <div>
    <div style="width:100%;height:5px;background-color:#F8F8F8"></div>
    <div class="a">
      <div class="b">
        <div class="b_1">
          <img :src="detailInfo.goodsImage" alt />
        </div>
        <div class="b_2">
          <div class="b_21">{{detailInfo.comName}}</div>
          <div class="b_22">数量 X{{detailInfo.goodsCount}}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getFun } from "@/api/publicFun.js";
let publicFun = getFun();
export default {
  data() {
    return {
      url1: this.$api+'/marketorderservice/api/v1/market/orders', // 获取订单详情的接口
      ordersId: "",
      userId: '',
      isBuyer: false, // 用于绑定是否是买家
      isSeller: false, // 用于绑定是否是卖家
      detailInfo: {} // 绑定订单对象
    };
  },
  props: [],
  methods: {
    getData() {
      let that = this;
      this.$Axios2
        .Get(this.url1 + "/" + this.ordersId + "/" + this.userId)
        .then(function(res) {
          // 判定是买家还是卖家
          if (res.data.orders.userId == that.userId) {
            that.isBuyer = true;
          }
          if (res.data.orders.suserId == that.userId) {
            that.isSeller = true;
          }
          that.detailInfo = res.data.orders;
        });
    }
  },
  mixins: [publicFun], //混入
  mounted() {
	this.ordersId = this.$router.currentRoute.query.ordersId;
  this.userId = this.$router.currentRoute.query.userId;
	this.getData();
  }
};
</script>

<style scoped="">
.b {
  display: flex;
  padding: 15px;
}
.b_1 img {
  width: 60px;
  height: 60px;
  display: block;
  border-radius: 5px;
}
.b_2 {
  flex: 1;
  padding: 0 20px 0 10px;
}
.b_21 {
  font-size: 14px;
  display: -webkit-box;
  font-weight: bold;
  opacity: 0.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.b_22 {
  color: #ccc;
  margin-top: 5px;
}
.a {
  padding: 10px;
}
</style>